<script >
export default {
    name: "Header",
    data(){
        return {
            manager:JSON.parse(sessionStorage.getItem("manager")),
        }
    },
    methods: {
        toUser(){
            this.$router.push("/managerHome")
        } ,
        logout(){
            this.$confirm('是否退出','提示',{
                confirmButtonText: '确定',
                type: 'warning',
                center: true,
            }).then(() => {
                this.$notify({
                    title: '成功',
                    message: '退出成功',
                    type: 'success'
                });
                this.$router.replace("/managerLogin")
                sessionStorage.clear()

            })
        }
    },
}

</script>

<template>
    <el-row type="flex" class="row-bg" justify="end" style="padding: 0;margin: 0;height:8vh;align-items: center">
        <el-col :span="2">
            <el-dropdown>
                <div class="el-dropdown-link">
                    <span>{{ manager.name }}</span>
                    <i class="el-icon-arrow-down" style="margin-left: 5px"></i>
                </div>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="toUser">个人中心</el-dropdown-item>
                    <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
                </el-dropdown-menu>

            </el-dropdown>
        </el-col>
    </el-row>
</template>

<style scoped>

</style>